package web;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.Hotel;
import dao.HDao;
import dao.HDaoimpl;

/**
 * Servlet implementation class ToServlet 
 */
@WebServlet("/ToServlet")
public class ToServlet extends HttpServlet {
	
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html; charset=UTF-8");
		
		String id = request.getParameter("id");
		HDao hd = new HDaoimpl();
		Hotel hotel = hd.to(id);
		
		request.setAttribute("h", hotel);
		request.getRequestDispatcher("Update.jsp").forward(request, response);
	}

}
